<body>
<div class="container-fluid p-t-15">
    <div id="chakan" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <h4 class="modal-title" id="myModalLabel">查看详情</h4>
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                    </div>
                    <div class="modal-body">
                        <div class="form-group">
                        <label>工单编号:</label>
                        <input type="text" class="form-control ca1" readonly="readonly">
                    </div>
					<div class="form-group">
                        <label>工单类型:</label>
                        <input type="text" class="form-control ca2" readonly="readonly">
                    </div>
					<div class="form-group">
                        <label>工单标题:</label>
                        <input type="text" class="form-control ca3" readonly="readonly">
                    </div>
					<div class="form-group">
                        <label>工单内容:</label>
                        <textarea  type="text"  rows="4" class="form-control ca4" readonly="readonly"></textarea>
                    </div>
					<div class="form-group">
                        <label>官方回复:</label>
                        <textarea  type="text"  rows="4" class="form-control ca5" readonly="readonly"></textarea>
                    </div>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-light" data-dismiss="modal">关闭</button>
                    </div>
                </div><!-- /.modal-content -->
            </div><!-- /.modal-dialog -->
        </div><!-- /.modal -->
  <div id="tijiao" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
    <div class="modal-content">
        <div class="modal-header">
            <h4 class="modal-title" id="myModalLabel">提交工单</h4>
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
        </div>
        <div class="modal-body">
            <div class="form-group mb-3">
            <label for="example-select">问题类型</label>
            <select class="form-control" id="types" name="types">
                <?php echo $conf['pay_work_name'];?>
            </select>
        </div>
    	<div class="form-group">
            <label>工单标题:</label>
            <input type="biaoti" name="biaoti" class="form-control" >
        </div>
    	<div class="form-group">
            <label>工单内容:</label>
            <textarea  type="text"  name="text" rows="4" class="form-control" ></textarea>
        </div>
    	<div class="form-group">
            <label>联系QQ:</label>
            <input type="text" class="form-control" name="qq"  value="<?=$userrow['qq']?>">
        </div>
        </div>
        <div class="modal-footer">
    	    <button type="button" class="btn btn-primary" onclick="swork();">提交</button>
            <button type="button" class="btn btn-light" data-dismiss="modal">关闭</button>
        </div>
    </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div><!-- /.modal -->      
    
<div class="row">
       <div class="col-lg-12">
        <div class="card">
            <div class="card-body">
                <div>
                <h4 class="header-title">工单系统说明</h4>
                <p class="text-muted font-14 mb-4">
                    使用过程中遇到什么问题您都可以到这里给管理员反馈的哟！.
                </p>
                <div class="col-lg-4">
                <div class="text-lg-left">
                    <button type="submit" data-toggle="modal" data-target="#tijiao" data-id="tijiao" class="btn btn-success mb-2 mr-2"><i class="mdi mdi-bolnisi-cross"></i> 提交工单</button>
                </div>
            </div>
            <div class="table-responsive-sm">
                <table class="table table-striped table-centered mb-0">
                    <thead>
                        <tr>
                            <th>工单编号</th>
                            <th>工单类型</th>
                            <th>工单标题</th>
                            <th style="display: none;">工单内容</th>
                            <th>提交时间</th>
                            <th style="display: none;">官方回复</th>
    						<th>完结时间</th>
    						<th>状态/详情</th>
                        </tr>
                    </thead>
                <tbody>
                     <?php 
                     
                     foreach ($result as $res) {
                         $btn = ($res['active'] == '1') ? '<a class="btn btn-success"  data-toggle="modal" data-target="#chakan" data-id="chakan" >已完结/查看详情</a>' : '<a class="btn btn-warning" data-toggle="modal" data-target="#chakan" data-id="edit" >未完结/查看详情</a>';
                        $rowData = [
                            ['label' => $res['num']],
                            ['label' => $res['types']],
                            ['label' => $res['biaoti']],
                            ['label' => $res['text'],'style'=>'display: none;'],
                            ['label' => $res['edata']],
                            ['label' => $res['huifu'],'style'=>'display: none;'],
                            ['label' => $res['wdata']],
                            ['label' => $btn]
                        ];
                        $html .= Splicing_form($rowData);   
                    }
                    echo $html;
                   table_page($page,$pages,'work');
                ?>
<script type="text/javascript" src="<?=userassets?>core_js/work.js"></script>